import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 随访发起记录信息 */
export interface FollowUpRecord {
          id: number; // 随访记录ID
          templateId?: number; // 随访模板ID
          userId?: number; // 用户ID
          adminUserId?: number; // 医生ID
          title?: string; // 随访标题
          beginTime?: string | Dayjs; // 随访开始时间
          endTime?: string | Dayjs; // 随访结束时间
          durationHour?: number; // 时长（小时）
  }

// 随访发起记录 API
export const FollowUpRecordApi = {
  // 查询随访发起记录分页
  getFollowUpRecordPage: async (params: any) => {
    return await request.get({ url: `/business/follow-up-record/page`, params })
  },

  // 查询随访发起记录详情
  getFollowUpRecord: async (id: number) => {
    return await request.get({ url: `/business/follow-up-record/get?id=` + id })
  },

  // 新增随访发起记录
  createFollowUpRecord: async (data: FollowUpRecord) => {
    return await request.post({ url: `/business/follow-up-record/create`, data })
  },

  // 修改随访发起记录
  updateFollowUpRecord: async (data: FollowUpRecord) => {
    return await request.put({ url: `/business/follow-up-record/update`, data })
  },

  // 删除随访发起记录
  deleteFollowUpRecord: async (id: number) => {
    return await request.delete({ url: `/business/follow-up-record/delete?id=` + id })
  },

  /** 批量删除随访发起记录 */
  deleteFollowUpRecordList: async (ids: number[]) => {
    return await request.delete({ url: `/business/follow-up-record/delete-list?ids=${ids.join(',')}` })
  },

  // 导出随访发起记录 Excel
  exportFollowUpRecord: async (params) => {
    return await request.download({ url: `/business/follow-up-record/export-excel`, params })
  },
}